// This is the main DLL file.

#include <WinSock2.h>
#include <WS2tcpip.h>

#pragma comment(lib, "ws2_32.lib")

using namespace System;
using namespace System::IO;
using namespace System::Text;
using namespace System::Runtime::InteropServices;

#include "Win32Thread.h"
#include "Win32Socket.h"

#pragma unmanaged

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
{ 
    switch (reason)
	{
	case DLL_PROCESS_ATTACH:
		WSADATA wsaData;
		return WSAStartup(MAKEWORD(2, 2), &wsaData) == 0;
	case DLL_PROCESS_DETACH:
		return WSACleanup() == 0;
	default:
		return TRUE; 
	}
}

#pragma managed
